	<script type="text/javascript">
    /* <![CDATA[ */
    $(document).ready(function()
    {
		$('#JavascriptOptionsDiv').show();
		$('#FAQDiv').show();
		$('#JavascriptLoadingDiv').hide();
    });
    /* ]]> */
    </script>
    <style type="text/css">
    .FAQ_Answer_Content {border: 2px inset white; padding: 10px;}
    .FAQ_Answer p {padding: 10px;}
	#JavascriptLoadingDiv, #JavascriptOptionsDiv, .JavascriptCloseFAQDiv {display: none;}
    </style>
	
    <div class="clear"></div>
{% if FAQs %}
    <div id="JavascriptLoadingDiv"></div>
    <script>
    /* <![CDATA[ */
	    $('#JavascriptLoadingDiv').html("Loading FAQ...");
		$('#JavascriptLoadingDiv').show();
    /* ]]> */
    </script>
    <div id="JavascriptOptionsDiv">
		<p><a href="" id="ShowHideAllFAQs" onclick="ToggleAllFAQs(); return false;">Show All</a></p>
		<p><input type="checkbox" id="PopupFAQ"><label for="PopupFAQ">Show answer in popup window on click</label></p>
	</div>
    <div id="FAQDiv">
		<h2><a id="FAQ_TOC">FAQ Index</a></h2>
		<ul>
		{% for category in Categories %}
			{% with category_dict=FAQs|getitem:category %}
			<li>
				<a href="#{{category|slugify}}">{{category}}</a>
				<ul>
				{% for subcategory in Subcategories %}
					{% if subcategory in category_dict %}
					{% with faq_list=category_dict|getitem:subcategory %}
						{% if subcategory != '__general' or category_dict.keys|length > 1 %}
						<li><a href="#{{category|slugify}}_{{subcategory|slugify}}">{% if subcategory == '__general' %}General{% else %}{{subcategory}}{% endif %}</a>
						<ul>
						{% endif %}
						{% for faq in faq_list %}
							<li><a href="#{{category|slugify}}_{{subcategory|slugify}}_{{faq.question_link|slugify}}">{{faq.question}}</a></li>
						{% endfor %}
						{% if subcategory != '__general' or category_dict.keys|length > 1 %}
						</ul>
						{% endif %}
					{% endwith %}
					{% endif %}
				{% endfor %}
				</ul>
			</li>
			{% endwith %}
		{% endfor %}
		</ul>
		<hr>
		{% for category in Categories %}
			{% with category_dict=FAQs|getitem:category %}

			<h1><a id='{{category|slugify}}'>{{category}}</a></h1>
			<ul>
				{% for subcategory in Subcategories %}
					{% if subcategory in category_dict %}
					{% with faq_list=category_dict|getitem:subcategory %}
						{% if subcategory != '__general' or category_dict.keys|length > 1 %}
						<li><a href="#{{subcategory|slugify}}"><h2>{% if subcategory == '__general' %}General{% else %}{{subcategory}}{% endif %}</h2></a>
						<ul>
						{% endif %}
						{% for faq in faq_list %}
						<li><div class="FAQ_Question"><a id="{{category|slugify}}_{{subcategory|slugify}}_{{faq.question_link|slugify}}"><h3>{{faq.question}}</h3></a></div>
						<div class="FAQ_Answer" id="{{category|slugify}}_{{subcategory|slugify}}_{{faq.question_link|slugify}}_answer" question_link="{{faq.question_link|slugify}}">
							<a href="#FAQ_TOC">(back to main help contents)</a>
							<div class="FAQ_Answer_Content">
							<h2><a id="TOC_{{category|slugify}}_{{subcategory|slugify}}_{{faq.question_link|slugify}}">Contents:</a></h2>
							<ul>
								{% if faq.quick_answer %}<li><a href="#quick_{{category|slugify}}_{{subcategory|slugify}}_{{faq.question_link|slugify}}">Quick Answer</a></li>{% endif %}
								{% if faq.answer %}<li><a href="#full_{{category|slugify}}_{{subcategory|slugify}}_{{faq.question_link|slugify}}">Full Answer</a></li>{% endif %}
								{% if faq.advanced_answer %}<li><a href="#advanced_{{category|slugify}}_{{subcategory|slugify}}_{{faq.question_link|slugify}}">Advanced Answer</a></li>{% endif %}
							</ul>
							<hr>
							{% if faq.quick_answer %}<h2><a id="quick_{{category|slugify}}_{{subcategory|slugify}}_{{faq.question_link|slugify}}">Quick Answer:<a></h2>{% if faq.needs_rendering %}{%render faq.quick_answer %}{%else%}{{faq.quick_answer|safe}}{%endif%}<br><a href="#{{category|slugify}}_{{subcategory|slugify}}_{{faq.question_link|slugify}}">Back to answer contents</a>{% endif %}
							{% if faq.quick_answer and faq.answer %}<hr>{% endif %}
							{% if faq.answer %}<h2><a id="full_{{category|slugify}}_{{subcategory|slugify}}_{{faq.question_link|slugify}}">Full Answer:</a></h2>{% if faq.needs_rendering %}{%render faq.answer %}{%else%}{{faq.answer|safe}}{%endif%}<br><a href="#{{category|slugify}}_{{subcategory|slugify}}_{{faq.question_link|slugify}}">Back to answer contents</a>{% endif %}
							{% if faq.advanced_answer and faq.answer %}<hr>{% endif %}
							{% if faq.advanced_answer %}<h2><a id="advanced_{{category|slugify}}_{{subcategory|slugify}}_{{faq.question_link|slugify}}">Advanced Answer:</a></h2>{% if faq.needs_rendering %}{%render faq.advanced_answer %}{%else%}{{faq.advanced_answer|safe}}{%endif%}<br><a href="#{{category|slugify}}_{{subcategory|slugify}}_{{faq.question_link|slugify}}">Back to answer contents</a>{% endif %}
							<br><div class="JavascriptCloseFAQDiv"><br><a href="" id="{{category|slugify}}_{{subcategory|slugify}}_{{faq.question_link|slugify}}_end" onclick="ToggleFAQ($('div#{{category|slugify}}_{{subcategory|slugify}}_{{faq.question_link|slugify}}_answer')); return false;">Close this answer</a></div>
							</div>
							<br><br>
						</div>
						</li>
						{% endfor %}
						{% if subcategory != '__general' or category_dict.keys|length > 1 %}
						</ul>
						{% endif %}
					{% endwith %}
					{% endif %}
				{% endfor %}
			</ul>
			{% endwith %}
		{% endfor %}
    </div>
	<script>
    /* <![CDATA[ */
		$('#FAQDiv').hide();
		$('.JavascriptCloseFAQDiv').show();
		$('.FAQ_Answer').hide();
		$('.FAQ_Question a:first-child').click(function(){ToggleFAQ($('div#' + $(this).attr('id') + '_answer')); return false;});
		$('.FAQ_Question a:first-child').attr('href','');		
    /* ]]> */
    </script>
{% else %}
    <p>No FAQs to display</p>
{% endif %}